/* global Page, xhs */
const http = require('../../util/http')
Page({

  data: {
    baseurl: http.baseURL,
    userInfo:null
  },
  onShow() {
    this.getuserInfor()
  },
  clickOrderList(e) {
    xhs.navigateTo({
      url: "/entry/orderList/index"
    });
  },
  clickCouponList(e) {
    xhs.navigateTo({
      url: "/entry/couponList/index"
    });
  },

  getuserInfor(){
    http.get('/api/xhs/getMemberInfo').then(res => {
      console.log('res',res)
      if (res.code == 200) {
        this.setData({
          userInfo: res.data
        })
      }else{
        xhs.navigateTo({
            url: "/entry/login/index"
        });
      }
    })
  }
});
